package com.zhou.blog.controller;

import com.zhou.blog.service.TagService;
import com.zhou.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @title:TagsController
 * @Author Zhou
 * @Date:2022/4/18 21:40
 * @Version 1.0
 */
@RestController
@RequestMapping("api/tags")

public class TagsController {
    @Autowired
    private TagService tagService;

    @GetMapping
    public Result findAll(){
        return tagService.findAll();
    }



    @GetMapping("hot")
    public Result hot(){
        int limit = 6;
        return tagService.Hots(limit);
    }
    @GetMapping("detail")
    public Result findAllDetail(){
        return tagService.findAllDetail();
    }
    @GetMapping("detail/{id}")
    public Result findDetailById(@PathVariable("id") Long id){
        return tagService.findDetailById(id);
    }

}
